package cn.yuanqiao.archive.appManager.mapper;

import cn.yuanqiao.archive.appManager.domain.TenantCodeList;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author zjj
 * @date 2023/6/16
 */
public interface TenantCodeListMapper {
    int insertTenantCodeList(TenantCodeList tenantCodeList);

    int createCodeListTable(@Param("tableName") String tableName);

    void initCodeList(@Param("tableName")String tableName, @Param("categoryIds") String categoryIds);

    List<TenantCodeList> getCodeListModel(Long codeRuleId);


    /**
     * 查询codelist
     *
     * @param Id codelist主键
     * @return codelist
     */
    public TenantCodeList selectYqdaCodelistModelById(Long Id);

    /**
     * 查询codelist列表
     *
     * @param yqdaCodelistModel codelist
     * @return codelist集合
     */
    public List<TenantCodeList> selectYqdaCodelistModelList(TenantCodeList yqdaCodelistModel);


    /**
     * 修改codelist
     *
     * @param yqdaCodelistModel codelist
     * @return 结果
     */
    public int updateYqdaCodelistModel(TenantCodeList yqdaCodelistModel);

    /**
     * 删除codelist
     *
     * @param Id codelist主键
     * @return 结果
     */
    public int deleteYqdaCodelistModelById(Long Id);

    /**
     * 批量删除codelist
     *
     * @param Ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteYqdaCodelistModelByIds(Long[] Ids);

    List<String> selectNodeValByIdAndType(@Param("ruleId") Long ruleId, @Param("type") String type, @Param("tableName") String tableName);

    List<String> selectNodeValByIdAndTypeGd(@Param("ruleId") Long ruleId, @Param("type") String type, @Param("tableName") String tableName);

    List<String> selectNodeValByIdAndTypeLen(@Param("ruleId") Long ruleId, @Param("type") String type, @Param("tableName") String tableName);

    int deleteYqdaCodelistModelByRuleId(@Param("id") Long id, @Param("tableName") String tableName);

    Map<String,String> getCodeListByRq(@Param("categoryId") Long categoryId, @Param("codeListTable") String codeListTable, @Param("codeRuleTable") String codeRuleTable, @Param("rq") Integer rq);

    List<Map<String,String>> getCodeListByCategoryId(@Param("categoryId") Long categoryId, @Param("codeListTable") String codeListTable,
                                                     @Param("codeRuleTable") String codeRuleTable, @Param("rq") Integer rq,
                                                     @Param("type")String type, @Param("VFETYPE") String VFETYPE);

}
